package com.wzc.basic.interceptor.config;

import com.wzc.basic.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyConfig implements WebMvcConfigurer {
    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor) // 使用的拦截器loginInterceptor
                .addPathPatterns("/**") // add  拦截的路径
                .excludePathPatterns("/fastdfs/**") // exclude  放行的路径: log上传
                .excludePathPatterns("/login/**") // 登录压面
                .excludePathPatterns("/shop/settlement/") // 商家入驻
                .excludePathPatterns("/verifyCode/**") // 验证码
                .excludePathPatterns("/swagger-resources/**", "/webjars/**","/v2/**", "/swagger-ui.html/**");
    }







}
